package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaClinicMapper;
import com.yiyahui.project.erp.domain.YiyaClinic;
import com.yiyahui.project.erp.service.IYiyaClinicService;

/**
 * 门诊Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-03
 */
@Service
public class YiyaClinicServiceImpl implements IYiyaClinicService 
{
    @Autowired
    private YiyaClinicMapper yiyaClinicMapper;

    /**
     * 查询门诊
     * 
     * @param id 门诊ID
     * @return 门诊
     */
    @Override
    public YiyaClinic selectYiyaClinicById(Long id)
    {
        return yiyaClinicMapper.selectYiyaClinicById(id);
    }

    /**
     * 查询门诊列表
     * 
     * @param yiyaClinic 门诊
     * @return 门诊
     */
    @Override
    public List<YiyaClinic> selectYiyaClinicList(YiyaClinic yiyaClinic)
    {
        return yiyaClinicMapper.selectYiyaClinicList(yiyaClinic);
    }

    /**
     * 新增门诊
     * 
     * @param yiyaClinic 门诊
     * @return 结果
     */
    @Override
    public int insertYiyaClinic(YiyaClinic yiyaClinic)
    {
        yiyaClinic.setCreateTime(DateUtils.getNowDate());
        return yiyaClinicMapper.insertYiyaClinic(yiyaClinic);
    }

    /**
     * 修改门诊
     * 
     * @param yiyaClinic 门诊
     * @return 结果
     */
    @Override
    public int updateYiyaClinic(YiyaClinic yiyaClinic)
    {
        yiyaClinic.setUpdateTime(DateUtils.getNowDate());
        return yiyaClinicMapper.updateYiyaClinic(yiyaClinic);
    }

    /**
     * 批量删除门诊
     * 
     * @param ids 需要删除的门诊ID
     * @return 结果
     */
    @Override
    public int deleteYiyaClinicByIds(Long[] ids)
    {
        return yiyaClinicMapper.deleteYiyaClinicByIds(ids);
    }

    /**
     * 删除门诊信息
     * 
     * @param id 门诊ID
     * @return 结果
     */
    @Override
    public int deleteYiyaClinicById(Long id)
    {
        return yiyaClinicMapper.deleteYiyaClinicById(id);
    }
}
